<template>
    <div>
        <van-nav-bar title="首页" />
        <van-tabs v-model:active="active" animated>
            <van-tab title="商城">
                <van-search v-model="value" shape="round" placeholder="请输入搜索关键词" @click="ss"/>
            </van-tab>
            <van-tab title="服饰">内容 2</van-tab>
            <van-tab title="鞋饰">内容 3</van-tab>
            <van-tab title="玩具">内容 4</van-tab>
        </van-tabs>

        <!-- 轮播 -->
        <van-swipe :autoplay="3000" lazy-render>
            <van-swipe-item v-for="image in images" :key="image">
                <img :src="image" style="width: 150px; height: 150px;" />
            </van-swipe-item>
        </van-swipe>

        <!-- 宫格 -->
        <van-grid :column-num="4">
            <van-grid-item v-for="value in 4" :key="value" icon="photo-o" text="文字" />
        </van-grid>

        <van-card num="2" price="2.00" desc="描述信息" title="商品标题"
            thumb="https://fastly.jsdelivr.net/npm/@vant/assets/ipad.jpeg" />
        <van-card num="2" price="2.00" desc="描述信息" title="商品标题"
            thumb="https://fastly.jsdelivr.net/npm/@vant/assets/ipad.jpeg" />
        <van-card num="2" price="2.00" desc="描述信息" title="商品标题"
            thumb="https://fastly.jsdelivr.net/npm/@vant/assets/ipad.jpeg" />
    </div>
</template>

<script setup>
import router from '@/router';
import { ref } from 'vue';
const active = ref(0);

const images = [
    'https://fastly.jsdelivr.net/npm/@vant/assets/apple-1.jpeg',
    'https://fastly.jsdelivr.net/npm/@vant/assets/apple-2.jpeg',
    'https://fastly.jsdelivr.net/npm/@vant/assets/apple-3.jpeg',
    'https://fastly.jsdelivr.net/npm/@vant/assets/apple-4.jpeg',
];

let ss=()=>{
    router.push('/ss')
}
</script>

<style lang="scss" scoped></style>